﻿@using EquipmentManager.Entities
@model EquipmentManager.Models.ListModel<EquipmentBase, PostOffice>

@{
    ViewBag.Title = "Список оборудования";
}

@section menu {
    <section class="featured">
            <div class="master-menu">
                @{Html.RenderPartial("AdminMenu");}
            </div>
    </section>
}

<p>@Html.ActionLink("+ Добавить новое оборудование", "CreateEquipment", "Admin", new { @PostOfficeId = Model.Parent.Id}, new { @class = "common-btn BlueColor" })</p>

<h2>Список оборудования по отделению @Model.Parent.Name в районе @Model.Parent.Region.Name в дирекции @Model.Parent.Region.Directorate.Name</h2>

<table class="bordered">
    <thead>
        <tr>
            <th>Инвентарный номер</th>
            <th>Серийный номер</th>
            <th>Название</th>
            <th>Описание</th>
            <th>Год введения</th>
            <th>Состояние</th>
            <th>Примечание</th>
            <th>Детали</th>
            <th>Правка</th>
            <th>Удалить</th>
        </tr>
    </thead>
    @foreach (var equipment in Model.ListItems)
    {
        <tr>
            <td>@equipment.Number</td>
            <td>@equipment.SerialNumber</td>
            <td>@equipment.Name</td>
            <td>@equipment.Description</td>
            <td>@equipment.Year</td>
            <td>@equipment.State</td>
            <td><pre>@equipment.Note</pre></td>
            <td class="Center column-detail">@Html.ActionLink("Детали", "DetailEquipment", "Admin", new { EquipmentId = equipment.Id }, new { @class = "common-btn BlueColor" })</td>
            <td class="Center column-detail">@Html.ActionLink("Правка", "EditEquipment", "Admin", new { EquipmentId = equipment.Id }, new { @class = "common-btn BlueColor" })</td>
            <td class="Center column-detail">@Html.ActionLink("Удалить", "DeleteEquipment", "Admin", new { EquipmentId = equipment.Id }, new { @class = "common-btn RedColor" })</td>
        </tr>
    }
</table>

<p>
     @Html.ActionLink("Назад", "PostOffices", "Admin", new { @RegionId = Model.Parent.Region.Id }, new { @class = "common-btn-large BlueColor" })
</p>
